BSP_ROOT ?= /mnt/c74c458c-838a-4973-9607-bb113f86d19c/rt-thread-os/rt-thread-master/bsp/stm32/stm32f407-st-discovery
RTT_ROOT ?= /mnt/c74c458c-838a-4973-9607-bb113f86d19c/rt-thread-os/rt-thread-master

CROSS_COMPILE ?=/usr/bin/arm-none-eabi-

CFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
AFLAGS := -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -x assembler-with-cpp -Wa,-mimplicit-it=thumb  -gdwarf-2
LFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds
CXXFLAGS := -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
EXTERN_LIB := -lc -lm 

CPPPATHS :=-I$(BSP_ROOT)/applications \
	-I$(RTT_ROOT)/components/libc/compilers/newlib \
	-I$(RTT_ROOT)/components/libc/compilers/common/include \
	-I$(RTT_ROOT)/components/drivers/include \
	-I$(BSP_ROOT)/board \
	-I$(BSP_ROOT)/board/CubeMX_Config/Inc \
	-I$(RTT_ROOT)/bsp/stm32/libraries/HAL_Drivers/drivers \
	-I$(RTT_ROOT)/bsp/stm32/libraries/HAL_Drivers/drivers/config \
	-I$(RTT_ROOT)/bsp/stm32/libraries/HAL_Drivers \
	-I$(RTT_ROOT)/bsp/stm32/libraries/HAL_Drivers/CMSIS/Include \
	-I$(RTT_ROOT)/components/finsh \
	-I$(BSP_ROOT) \
	-I$(RTT_ROOT)/include \
	-I$(RTT_ROOT)/libcpu/arm/common \
	-I$(RTT_ROOT)/libcpu/arm/cortex-m4 \
	-I$(RTT_ROOT)/bsp/stm32/libraries/STM32F4xx_HAL/STM32F4xx_HAL_Driver/Inc \
	-I$(RTT_ROOT)/bsp/stm32/libraries/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Include \
	-I$(RTT_ROOT)/components/libc/posix/io/poll \
	-I$(RTT_ROOT)/components/libc/posix/io/eventfd \
	-I$(RTT_ROOT)/components/libc/posix/io/epoll \
	-I$(RTT_ROOT)/components/libc/posix/ipc 

DEFINES := -DRT_USING_LIBC -DRT_USING_NEWLIBC -DSTM32F407xx -DUSE_HAL_DRIVER -D_POSIX_C_SOURCE=1 -D__RTTHREAD__
